Algunos problemas de DP. Uno de ellos utiliza BigInteger e I/O de Java.
[and.git] / 11436 - Cubes EXTREME! / blah.cpp
blob3619fb5dfdf20d9e3d667c945f2999b1aa750585
1 #include <iostream>
2 #include <iterator>
3 #include <vector>
4 using namespace std;
6 typedef unsigned long long ull;
8 int main(){
9 ull n;
10 while (cin >> n && n){
11 vector<ull> d;
12 for (ull i=1; i*i<=n; i++) {
13 if (n%i == 0) {
14 d.push_back(i);
15 if (i*i<n) d.push_back(n/i);
18 sort(d.begin(), d.end());
19 copy(d.begin(), d.end(), ostream_iterator<ull>(cout, " "));
20 cout << endl;
22 return 0;